using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class ErrorHandler : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            Exception exception2handle = Server.GetLastError().GetBaseException();

            _errorTitle.Text = "Oh no, an error!";
            _errorMessage.Text = exception2handle.Message;

            if (User.IsInRole("Admin"))
            {
                _errorStack.Text = Server.HtmlEncode(exception2handle.ToString());
            }

            Server.ClearError();
        }
        catch (Exception ex)
        {

            throw;
        }
    }
}
